home *** CD-ROM | disk | FTP | other *** search
- //
- // on my A500 (68020, 33 mhz, 8 MB) I got this results:
- // loop 20 secs
- // array 241 secs
-
-
- decsub ctimer ();
- decsub ptimer ();
-
- int i; int j; int x; int y;
- int a1[400][400]; int a2[400][400];
- int loop; int array;
- lint secs; lint tcks;
-
- print /n;
-
- // loop test
-
- ton;
- i = 0;
- while i <= 399;
- j = 0;
- while j <= 399;
- inc j;
- wend;
- inc i;
- wend;
- toff;
-
- call ctimer ();
- printvn loop;
- call ptimer ();
-
-
- // array test
-
- ton;
- i = 0;
- while i <= 399;
- j = 0;
- while j <= 399;
- a1[i][j] = j;
- a2[i][j] = j;
- inc j;
- wend;
- inc i;
- wend;
-
- i = 0;
- while i <= 399;
- j = 0;
- while j <= 399;
- x = a1[i][j];
- y = a2[i][j];
- x = x * y;
- a1[i][j] = x;
- a2[i][j] = x;
- inc j;
- wend;
- inc i;
- wend;
- toff;
-
- call ctimer ();
- printvn array;
- call ptimer ();
-
- exit;
-
- sub ctimer ();
- tcks = _timer;
- secs = _timer / _timertck;
- endsub;
-
- sub ptimer ();
- print /s2; print "ticks: ", tcks, /s2;
- print "secs: ", secs, /n2;
- endsub;
-